Skip to content

Add Activate on launch features to SekiroTool - #48

Open
gonlad-x wants to merge 4 commits into
borgCode:masterfrom
gonlad-x:activate-on-launch-clean
Open

Add Activate on launch features to SekiroTool#48
gonlad-x wants to merge 4 commits into
borgCode:masterfrom
gonlad-x:activate-on-launch-clean

Conversation

@gonlad-x

Copy link
Copy Markdown

It follows the same architecture as TarnishedTool. I tested all options and they appear to work as expected.

I also added Enable target options as an activable on launch feature (it it activated when the game is loaded, not when the tool is attached), as well as DB/NKC event flags (because I am lazy and do not like going to the bell to ring it on each practice run).

Finally, a small fix for No Emblem Consume.

SekiroTool_SZYq5tSP10

gonlad-x added 4 commits July 20, 2026 19:32
Port TarnishedTool's Activate On Launch feature: ActivateOnLaunchManager
for persisted settings storage, per-tool feature checklist, and the
same lifecycle-driven architecture as TarnishedTool/SilkySouls3 - a
master enable toggle, a singleton settings window opened via a bound
command from SettingsViewModel (with reuse/Activate() instead of
spawning duplicates), and AppStart/Attached/Loaded/GameStart state
subscriptions matching the reference implementation.

Feature list for Sekiro:
- Player: Infinite Confetti/Gachiin, One Shot Health/Posture, No Goods/
  Emblem Consume, Infinite Revival, Player Hide/Silent, Infinite Poise,
  No Death (+ ex-killbox variant), No Damage, and a Damage Multiplier
  value (defaults to 1.0, matching PlayerViewModel's default) instead
  of the relative increase/decrease toggles TarnishedTool uses.
- Target: Enable Target Options.
- Travel: Unlock All Idols, wired to TravelViewModel's existing
  UnlockIdolsCommand.
- New Game Cycle: Auto Set NG+7, Demon Bell on/off, No Kuro's Charm
  on/off.

No Enemies or Boss Skips sections - those are one-shot actions tied to
specific fight state rather than persistent toggles, and didn't fit
the Activate On Launch model cleanly for this game.
- Move Enable Target Options from AppStart to Loaded. The property
  setter it calls (TargetService.ToggleTargetHook -> ChangeIdolIcon)
  allocates and immediately executes shellcode built with offsets that
  are only resolved once PatchChecker.Initialize/AllocCodeCave have
  run - which is guaranteed by the time Loaded fires, but not by
  AppStart if the tool is opened after the game is already running.
  That gap reliably crashed the game.
- Move Auto Set NG+7 from GameStart to AppStart. It was previously
  primed on the same GameStart event that PlayerViewModel's own
  OnGameStart handler reads it on, and since PlayerViewModel
  subscribes to GameStart first, its check always ran before the flag
  was set - the option could never actually trigger.
PlayerViewModel's OnGameLoaded reapply block called
TogglePlayerNoGoodsConsume for IsNoEmblemConsumeEnabled instead of
TogglePlayerNoEmblemsConsume - a copy-paste typo. The property's own
setter was correct, so toggling the checkbox mid-session worked, but
the reapply path that runs on every load (which is what Activate On
Launch's priming depends on entirely) silently re-toggled No Goods
Consume a second time instead of ever touching emblem consumption.
gonlad-x added a commit to gonlad-x/SekiroToolFork that referenced this pull request Aug 1, 2026
Adopts the Activate On Launch feature from activate-on-launch-clean
(the branch behind upstream PR borgCode#48) in place of master's own Startup
options, and deletes StartupViewModel/StartupOptionViewModel and
StartupOptionsWindow.

Why the swap is a net gain rather than a straight substitution: master
listed 33 startup options but only 18 of them had a registered action,
and TriggerStartupAction silently no-ops on a missing one. So Demon Bell
On/Off, No Kuro's Charm On/Off, the boss skips, the dragon skips, the
damage-multiplier steps and Apply/Remove Confetti/Gachiin were all
tickable and did nothing. Activate On Launch wires Demon Bell and
No Kuro's Charm properly, and adds Infinite Confetti, Infinite Gachiin,
Unlock All Idols and a persisted damage-multiplier value.

The four options that master had working and Activate On Launch lacked
are ported over, kept on the same lifecycle events they were gated to
before, so no new State.AppStart exposure is introduced:
  - Pop Out Overlay, No Butterfly Summons, Snake Intro Loop -> Loaded
  - Max HP -> new game

NG+7 no longer needs the AppStart priming the upstream branch used.
master invokes SetNewGame7OnNewGame directly on new game instead of
setting a flag that PlayerViewModel's own GameStart handler reads, so
the subscribe-order race that priming worked around no longer exists.

Settings keys move from StartupActionIds/StartupOptionsEnabled to
ActivateOnLaunchActionIds/ActivateOnLaunchEnabled with no migration, so
existing selections are reset once and the old keys are dropped on the
next save.

The window now opens through OpenActivateOnLaunchCommand instead of a
code-behind Click handler that built a new window on every press.

HotkeyManager's now-unused _startupActions/_newGameActions registry and
its RegisterStartupAction/RegisterNewGameAction call sites are left in
place; removing them touches three more ViewModels and is cleaner as a
separate change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant